
/*****************************************************************************
 *
 * 作   者: 陈兴海 * 创建时间: 2022/11/23 16:28:59 *
 * Copyright (C) 2008 - 鹏业软件公司
 *
 *****************************************************************************/

import {DataPacket, NorDataList} from 'pengesoft-ng-lib';
import {CreditRule} from './creditrule.domain';

/**
 * 征信记录
 */
export class CreditRecord extends DataPacket {
  Id: string; // 征信编号
  CustomerId: string; // 用户编号
  CreditRuleId: string; // 描述
  PreScore: number; // 扣分前的分数
  CreateTime: Date; // 创建时间
  CreditRule: CreditRule; // 征信规则

  constructor(options: Partial<CreditRecord> = {}) {
    super();
    this.Id = options.Id || '';
    this.CustomerId = options.CustomerId || '';
    this.CreditRuleId = options.CreditRuleId || '';
    this.PreScore = !options.PreScore ? 0 : Number.parseFloat(options.PreScore.toString());
    this.CreateTime = this.newDate(options.CreateTime)!;
    this.CreditRule = new CreditRule(options?.CreditRule || {});
  }
}

/**
 * 征信记录列表
 */
export class CreditRecordList extends NorDataList<CreditRecord> {

  constructor(options: Partial<CreditRecordList> | Array<CreditRecord> = {}) {
    super(options, CreditRecord);
  }
}

